<script setup lang="ts">
import {SongList,Song} from '../../../interface'
import {computed, ref, Ref, toRaw} from "vue";
import {fixSongLong} from "../../../utils";
const props = defineProps<{
  songList: Array<SongList|undefined>
}>()
let songList = computed(()=>{
  if(songList){
    toRaw(props.songList).filter((item:any)=>{
      item.dt = fixSongLong(Number(item.dt))
    })
  }
  return props.songList
})
let songs =ref()
function add(row:any) {
  let temp:Song = {
    id: row.al.id
  }
  /**
   * 明天接着写=>
   */
}
</script>
<template>
  <el-table :data="songList" height="320" style="width: 100%" @row-dblclick="add">
    <el-table-column type="index" label="" width="200"/>
    <el-table-column prop="name" label="歌曲" width="400"/>
    <el-table-column prop="ar[0].name" label="歌手" width="200"/>
    <el-table-column prop="al.name" label="专辑" width="300"/>
    <el-table-column prop="dt" label="时长"/>
  </el-table>
</template>
<style lang="less" scoped>

</style>
